package com.g1.test;

import com.g1.entity.Admin;
import com.g1.entity.Cook;
import com.g1.entity.Finance;
import com.g1.entity.Teacher;
import com.g1.mapper.AdminMapper;
import com.g1.service.*;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.sql.DataSource;
import java.sql.SQLException;
import java.util.List;

public class Main {
    public static void main(String[] args) throws SQLException {
        ClassPathXmlApplicationContext ctx=new ClassPathXmlApplicationContext("application.xml");
//        StudentService bean = ctx.getBean(StudentService.class);
//        System.out.println("bean = " + bean.selectById((long)1001));
        TeacherService bean = ctx.getBean(TeacherService.class);

        Teacher teacher = new Teacher();




        List<Teacher> cooks = bean.selectAll();
        System.out.println(cooks);
//        Finance finance=new Finance();
//        finance.setName("水电费");
//        bean.insert(finance);
//        List<Finance> finances = bean.selectAll();
//        System.out.println("finances = " + finances);
    }
}
